import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    actionSheetModel: false,
    // 一级反馈面板
    firstActionSheet: [
      { name: '不感兴趣' },
      { name: '反馈垃圾内容' }
    ],
    // 二级反馈面板
    secondActionSheet: [
      {
        value: 0,
        name: '其它问题'
      },
      {
        value: 1,
        name: '标题夸张'
      },
      {
        value: 2,
        name: '低俗色情'
      },
      {
        value: 3,
        name: '错别字多'
      },
      {
        value: 4,
        name: '旧闻重复'
      },
      {
        value: 6,
        name: '内容不实'
      },
      {
        value: 8,
        name: '侵权'
      },
      {
        value: 5,
        name: '广告软文'
      },
      {
        value: 7,
        name: '涉嫌违法犯罪'
      }
    ],
    // 点击  x 时 获取到的文章ID
    artIdActions: 0,
    userImgUrl: '',
    editUserName: ''
  },
  mutations: {
    // 设置面板的显示 false 为取消，true为显示
    changeActionSheetModelMutations (state, val) {
      state.actionSheetModel = val
    },
    // 将获取到的 id 传递给 全局变量 artIdActions，方便在home主页中使用
    setArtIdActionsMUtations (state, val) {
      state.artIdActions = val
    },
    setUserImgUrlMUtations (state, val) {
      state.userImgUrl = val
    },
    setUserNameMUtations (state, val) {
      state.editUserName = val
    }
  },
  actions: {
  },
  modules: {
  }
})
